package cz.su.pod.ksocializer.server.poster;

import com.google.code.facebookapi.FacebookJsonRestClient;

import cz.su.pod.ksocializer.shared.domain.SocialNetwork;

public class FacebookPoster implements Poster {

	public final static String FACEBOOK_API_KEY = "228649713899487";  
	public final static String FACEBOOK_API_SECRET = "be030ec4ec78167a61af62fb07708eab";  
	public final static String SESSION_KEY = "2.AQAjFgvFUKLy7q1s.3600.1331985600.1-754733616";
	
	// MProks
	public final static String USER_ID = "754733616";
	public final static String FACEBOOK_PAGE_ID = "183428958346365"; 
	
	@Override
	public SocialNetwork getType() {
		return SocialNetwork.Facebook;
	}
	
	@Override
	public void postMessage(String message) throws Exception {		 
	    FacebookJsonRestClient client = new FacebookJsonRestClient(FACEBOOK_API_KEY, FACEBOOK_API_SECRET, SESSION_KEY);	    
	    client.stream_publish(message, null, null, new Long(FACEBOOK_PAGE_ID), new Long(USER_ID));
	}
}
